﻿@model BLL.Model.Menu.MenuInfo
@{
    Layout = null;
}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script type="text/javascript">
    function closeDialog() {
        $("#editDiv").data("dialog").close();
    }

    function getData() {
        return $("form").serialize();
    }

    function submit(url) {
        if (!url || url == "") {
            alert("没有设置提交的URL！");
            return;
        }
        $.post(url, getData(), function (result) {
            if (result == "ok") {
                alert("保存成功！");
                closeDialog();
            }
            else {
                alert(result);
            }
        });
    }

    $().ready(function () {
        $(":submit").button().click(function () {
            if ($("form").valid()) {
                submit("/menu/edit/");
            }
            return false;
        });
    });
</script>
@using (Html.BeginForm("Edit", "Menu"))
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>链接信息</legend>@*Name*@
        @Html.HiddenFor(model => model.Id)
        <div class="ez-wr" style="text-align: left; margin-top: 15px;">
            <div class="ez-box" style="margin: 5px;">
                <div class="ez-wr">
                    <div class="ez-fl ez-negmr ez-25" style="margin: 2px;">
                        <div class="ez-box">
                            @Html.LabelFor(model => model.Name)：
                        </div>
                    </div>
                    <div class="ez-last ez-oh">
                        <div class="ez-box">
                            @Html.TextBoxFor(model => model.Name, new { @class = "search_input" })
                            <em>
                                @Html.ValidationMessageFor(model => model.Name)
                            </em>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        @*Href*@
        <div class="ez-wr" style="text-align: left; margin-top: 15px;">
            <div class="ez-box" style="margin: 5px;">
                <div class="ez-wr">
                    <div class="ez-fl ez-negmr ez-25" style="margin: 2px;">
                        <div class="ez-box">
                            @Html.LabelFor(model => model.Href)：
                        </div>
                    </div>
                    <div class="ez-last ez-oh">
                        <div class="ez-box">
                            @Html.TextAreaFor(model => model.Href, 5, 10, new { @class = "search_input" })
                            <em>
                                @Html.ValidationMessageFor(model => model.Href)
                            </em>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        @*Order*@ @*<div class="ez-wr" style="text-align: left; margin-top: 15px;">
            <div class="ez-box" style="margin: 5px;">
                <div class="ez-wr">
                    <div class="ez-fl ez-negmr ez-25" style="margin: 2px;">
                        <div class="ez-box">
                            @Html.LabelFor(model => model.Order)：
                        </div>
                    </div>
                    <div class="ez-last ez-oh">
                        <div class="ez-box">
                            @Html.TextAreaFor(model => model.Order, 5, 10, new { @class = "search_input" })
                            <div>
                                @Html.ValidationMessageFor(model => model.Order)
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>*@ @*OpenNewWindow*@
        <div class="ez-wr" style="text-align: left; margin-top: 15px;">
            <div class="ez-box" style="margin: 5px;">
                <div class="ez-wr">
                    <div class="ez-fl ez-negmr ez-25" style="margin: 2px;">
                        <div class="ez-box">
                            @Html.LabelFor(model => model.OpenNewWindow)：
                        </div>
                    </div>
                    <div class="ez-last ez-oh">
                        <div class="ez-box">
                            @Html.EditorFor(model => model.OpenNewWindow)
                            <em>
                                @Html.ValidationMessageFor(model => model.OpenNewWindow)
                            </em>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <p>
            <input type="submit" value="保 存" />
        </p>
    </fieldset>
}
